import schedule
import pyautogui


def print_drink():
    click_result = pyautogui.alert(text='喝水……喝水……喝一杯水……', title='喝水提示', button='OK')


def start():
    our_time = pyautogui.prompt(text='输入间隔时间，单位分钟', title='时间间隔输入')
    print(our_time)
    try:
        our_time_int = int(our_time)
        schedule.every(our_time_int).minutes.do(print_drink)
        while True:
            schedule.run_pending()
    except Exception as e:
        print(e)
        print("时间输入错误")
        start()


start()
